package homework.day01;

import java.io.File;
import java.io.FileFilter;

public class Test02 {
    public static void main(String[] args) {
        File dir = new File("./src/main/java/file");
        if (dir.isDirectory()) {
            /*
            FileFilter filter=new FileFilter() {
                @Override
                public boolean accept(File file) {
                    String name=file.getName();
                   return name.contains("s");
                }
            };

             */


            File[] subs = dir.listFiles(f -> f.getName().contains("s"));
            for (File sub : subs) {
                System.out.println(sub.getName());

            }

        }
    }

}